package cmpe.swe.purcom.dao.extractor;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import cmpe.swe.purcom.model.Community;


public class CommunityResultSetExtractor implements
		ResultSetExtractor<Community> {

	
	@Override
	public Community extractData(ResultSet rs) throws SQLException,
			DataAccessException {
		Community c = new Community();
		c.setId(rs.getLong(1));
		c.setName(rs.getString(2));
		c.setDescription(rs.getString(3));
		c.setStatus(rs.getInt(4));
		c.setEnddate(rs.getTimestamp(5));
		c.setType(rs.getInt(6));
		return c;
	}

}
